 <!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			* {
				margin: 0;
				padding: 0;
			}
			
			#main {
				position: absolute;
				top: 200px;
				left: 150px;
			}
			
			span {
				position: absolute;
				top: -2px;
				right: 0px;
			}
		</style>
	</head>

	<body>

		<div><img src="img/contentpic.jpg"></div>
		<div id="main"><img src="img/advpic.jpg"><span id="mein" onclick="shanchu(this)"><img src="img/close.jpg"></span></div>

		<script type="text/javascript">
			var img = document.getElementById("main")
			var main;
			if(img.currentStyle) {
				main = parseInt(img.currentStyle.top)
			} else {
				main = parseInt(document.defaultView.getComputedStyle(img, null).top)
			}

			window.onscroll = function() {
				var top;
				if(document.body.scrollTop) {
					top = parseInt(document.body.scrollTop)
				} else {
					top = parseInt(document.documentElement.scrollTop)
				}
				img.style.top = main + top + "px"
			}
			var span = document.getElementById("mein")

			function shanchu(t) {
				if(confirm("È·¶¨É¾³ýÂð£¿")) {
					if(t.style.display = "none") {
						img.style.display = "none"
					}
				}
			}
		</script>
	</body>

</html>